package com.ruoyi.project.system.exam.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.exam.mapper.ExamSessionConfigMapper;
import com.ruoyi.project.system.exam.domain.ExamSessionConfig;
import com.ruoyi.project.system.exam.service.IExamSessionConfigService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 答题场次配置服务实现类
 * 
 * @author ruoyi
 * @date 2023-07-16
 */
@Service
public class ExamSessionConfigServiceImpl implements IExamSessionConfigService 
{
    @Autowired
    private ExamSessionConfigMapper examSessionConfigMapper;

    /**
     * 查询答题场次配置
     * 
     * @param id 答题场次配置主键
     * @return 答题场次配置
     */
    @Override
    public ExamSessionConfig selectExamSessionConfigById(Long id)
    {
        return examSessionConfigMapper.selectExamSessionConfigById(id);
    }

    /**
     * 查询答题场次配置列表
     * 
     * @param examSessionConfig 答题场次配置
     * @return 答题场次配置
     */
    @Override
    public List<ExamSessionConfig> selectExamSessionConfigList(ExamSessionConfig examSessionConfig)
    {
        return examSessionConfigMapper.selectExamSessionConfigList(examSessionConfig);
    }

    /**
     * 新增答题场次配置
     * 
     * @param examSessionConfig 答题场次配置
     * @return 结果
     */
    @Override
    public int insertExamSessionConfig(ExamSessionConfig examSessionConfig)
    {
        examSessionConfig.setCreateTime(DateUtils.getNowDate());
        return examSessionConfigMapper.insertExamSessionConfig(examSessionConfig);
    }

    /**
     * 修改答题场次配置
     * 
     * @param examSessionConfig 答题场次配置
     * @return 结果
     */
    @Override
    public int updateExamSessionConfig(ExamSessionConfig examSessionConfig)
    {
        examSessionConfig.setUpdateTime(DateUtils.getNowDate());
        return examSessionConfigMapper.updateExamSessionConfig(examSessionConfig);
    }

    /**
     * 批量删除答题场次配置
     * 
     * @param ids 需要删除的答题场次配置主键
     * @return 结果
     */
    @Override
    public int deleteExamSessionConfigByIds(Long[] ids)
    {
        return examSessionConfigMapper.deleteExamSessionConfigByIds(ids);
    }

    /**
     * 删除答题场次配置信息
     * 
     * @param id 答题场次配置主键
     * @return 结果
     */
    @Override
    public int deleteExamSessionConfigById(Long id)
    {
        return examSessionConfigMapper.deleteExamSessionConfigById(id);
    }
}